package com.umeox.watch.arithmetictest;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.umeox.moto.watch.themes.app.ThemeAppCompatActivity;

public class MainActivity extends ThemeAppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_main);
        findViewById(R.id.btLevel1).setOnClickListener(this);
        findViewById(R.id.btLevel2).setOnClickListener(this);
        findViewById(R.id.btLevel3).setOnClickListener(this);
    }


    @Override
    public void onClick(View v) {
        int level = 0;
        if (v.getId() == R.id.btLevel1) {
            level = 1;
        } else if (v.getId() == R.id.btLevel2) {
            level = 2;
        } else if (v.getId() == R.id.btLevel3) {
            level = 3;
        }
        if (level > 0) {
            Intent intent = new Intent(this, ArithmeticTestActivity.class);
            intent.putExtra("level", level);
            startActivity(intent);
        }
    }
}
